package com.zl.learning.netty.client;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Test;

import java.nio.ByteOrder;

public class MyTest {
    @Test
    public void test1() {
        ByteBuf byteBuf = Unpooled.buffer(34);
        byteBuf.writeInt(0xE005);
        byteBuf.writeShort(26);
        byteBuf.writeShort(0);
        byteBuf.writeInt(2019114);
        byteBuf.writeByte(1);
        byteBuf.writeLong(460090290101543L);
        byteBuf.writeLong(0L);
        byteBuf.writeInt((int) (System.currentTimeMillis() / 1000));
        byteBuf.writeByte(0);
        System.out.println(byteBuf.readInt());
        System.out.println(byteBuf.readShort());
        System.out.println(byteBuf.readShort());
        System.out.println(byteBuf.readInt());
        System.out.println(byteBuf.readByte());
        System.out.println(byteBuf.readLong());
        System.out.println(byteBuf.readLong());
        System.out.println(byteBuf.readInt());
        System.out.println(byteBuf.readByte());
    }
}
